Skip to main content

Week 3

Feb 02/13/23

  1. Questions for Vannary were added to the GitHub projects.

Training from scratch

Using fit_one_cycle and fit_flat_cos

  1. When we would create the Learner object, we would pass pretrained=False
  2. fine_tune method is to be used during transfer learning (not while training from scratch)
  3. Find ideal learning rate using lr = learn.lr_find()
  4. Call the learn.fit_one_cycle(no_of_epochs, lr[0])
  5. Then in a separate file
  6. Call the learn.fit_flat_cos(no_of_epochs, lr[0])
fit_one_cycle.py
learn = vision_learner(dls, resnet50, pretrained=False, cbs=WandbCallback())
ideal_lr = learn.lr_find()
learn.fit_one_cycle(no_of_epochs, lr[0])
fit_flat_cos.py
learn = vision_learner(dls, resnet50, pretrained=False, cbs=WandbCallback())
ideal_lr = learn.lr_find()
learn.fit_flat_cos(no_of_epochs, lr[0])